using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;

namespace kxjsj
{
    public partial class get_flds : Form
    {
        public ArrayList flds;
        public ArrayList flds_to_output;
        public get_flds()
        {
            InitializeComponent();
            flds = new ArrayList();
            flds_to_output = new ArrayList();
        }

        private void get_flds_Load(object sender, EventArgs e)
        {
            foreach (object fld in flds)
            {
                checkedListBox1.Items.Add(fld);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < checkedListBox1.CheckedIndices.Count ; i++)
            {
                flds_to_output.Add(checkedListBox1.CheckedIndices[i]);
            }
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked)
            {
                for (int b = 0; b < checkedListBox1.Items.Count; b++)
                {
                    this.checkedListBox1.SetItemChecked(b, true);
                }
            }
            else
            {
                for (int b = 0; b < checkedListBox1.Items.Count; b++)
                {
                    this.checkedListBox1.SetItemChecked(b, false );
                }
            }
        }
    }
}